package com.midian.action.mc.region;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.midian.action.mc.common.AjaxAction;
import com.midian.common.annotation.FunctionAnnotationOverride;
import com.midian.model.region.Region;
import com.midian.service.region.IRegionService;

/**
 * 地区Action
 * @author Mengfh
 *
 */
@Scope("prototype")
@Controller("regionAction")
@FunctionAnnotationOverride(isAction = true, auth = "地区管理")
public class RegionAction extends AjaxAction<Region> {
	/**地区实体*/
	private Region entity;
	/**地区实体列表*/
	private List<Region> rows;
	/**地区业务*/
	private IRegionService regionService;
	
	public Region getEntity() {
		return entity;
	}
	public void setEntity(Region entity) {
		this.entity = entity;
	}
	@Resource(name = "regionService")
	public void setRegionService(IRegionService regionService) {
		this.service = regionService;
		this.regionService = regionService;
	}
	@Override
	protected Region dytEntity() {
		if(this.entity == null) {
			this.entity = new Region();
		}
		return getEntity();
	}
	@Override
	protected void dyEntity(Region t) {
		setEntity(t);
	}
	@Override
	public void setRows(List<Region> rows) {
		this.rows = rows;
	}
	@Override
	public List<Region> getRows() {
		return rows;
	}
}
